[Round-10] Spring Batch를 활용한 주간/월간 랭킹 집계 구현 #17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📌 Summary
주간/월간 랭킹 집계 배치 구현
Redis 연동
배치 집계 완료 후 Redis ZSET에 반영
BoundZSetOperations.add(Set) 방식으로 단순화
랭킹 조회 API 개선
JPA 대신 JdbcBatchItemWriter + SQL upsert 방식으로 변경 (대규모 집계 성능 고려)
jdbc 방식선택에 따른 인덱스 추가
CREATE INDEX idx_pm_date_pid ON product_metrics(date, product_id);CREATE INDEX idx_psm_date_pid ON product_sku_metrics(date, product_id);💬 Review Points
- 집계된 ZSet 값을 집계하여 DB에 저장하는 방식에 대한 의견
- JPA 대신 JdbcBatchItemWriter + SQL upsert 방식에 대한 의견
✅ Checklist
🧱 Spring Batch
🧩 Ranking API
🚨Unfinished List